<#assign pageName="公共码表管理">
<@override name="page-content">
<form class="layui-form form-horizontal" role="form" method="post">
    <div class="layui-form-search panel">
        <input type="text" hidden="hidden" name="_STATE"/>
        <div class="layui-form-item margin-5">
            <label class="layui-form-label" for="tableName">码表名称</label>
            <div class="layui-input-inline">
                <input type="text" id="tableName" autocomplete="off" placeholder="请输入码表名称" class="layui-input width-190  " name="tableName" value="${tableName}" >
            </div>
        </div>
        <div class="margin-5">
            <a href="javascript:;" onclick="$('form:first').submit();" class="layui-btn layui-btn-sm">
                 <i class="layui-icon layui-icon-search"></i>查询
             </a>
             <a href="javascript:;" class="layui-btn layui-btn-warm layui-btn-sm js-reset">
                <i class="layui-icon layui-icon-refresh-1"></i>重置
             </a>
             <a href="addtype" class="layui-btn layui-btn-normal layui-btn-sm">
                <i class="layui-icon layui-icon-add-1"></i>新增
            </a>
        </div>
    </div>
    <table class="layui-table">
        <thead>
            <tr>
                <th class="align-center" width="50px" nowrap="nowrap">序号</th>
                <th class="align-center" nowrap="nowrap">码表名称</th>
                <th class="align-center" nowrap="nowrap">码表描述</th>
                <th class="align-center" nowrap="nowrap">创建时间</th>
                <th class="align-center" nowrap="nowrap">更新时间</th>
                <th class="align-center" width="120px">操作</th>
            </tr>
        </thead>
        <tbody>
            <#if codeTableList?has_content>
                <#list codeTableList as dataItem>
                <tr>
                    <td class="align-center" width="50px" nowrap="nowrap">
                        ${(pageNo-1)*pageSize+dataItem_index+1}
                    </td>
                    <td class="align-center" nowrap="nowrap">
                        ${dataItem.table_name}
                    </td>
                    <td class="center" nowrap="nowrap">
                        ${dataItem.table_comment}
                    </td>
                    <td class="align-center" nowrap="nowrap">
                        <#if dataItem.create_time?has_content>
                        ${dataItem.create_time?datetime}
                        <#else>
                            ——
                        </#if>
                    </td>
                    <td class="align-center" nowrap="nowrap">
                        <#if dataItem.modify_time?has_content>
                        ${dataItem.modify_time?datetime}
                        <#else>
                            ——
                        </#if>
                    </td>
                    <td class="align-center">
                        <div class="layui-table-cell">
                            <a href="javascript:;" class="layui-btn layui-btn-normal layui-btn-xs js-list"  data-id="${dataItem.table_name}" data-name="${dataItem.table_comment}">
                                <i class="layui-icon layui-icon-list"></i>详情
                            </a>
                             <a class="layui-btn layui-btn-normal layui-btn-xs" href="edittype/${dataItem.table_name}">
                              <i class="layui-icon layui-icon-edit"></i>编辑
                           </a> 
                           <button type="button" class="layui-btn layui-btn-danger layui-btn-xs"
                               onclick="confirmSubmit('确定要删除码表‘${dataItem.table_comment}’吗?', {id:'${dataItem.table_name}',name:'${dataItem.table_comment}'},'deltype')">
                               <i class="layui-icon layui-icon-delete"></i>删除
                           </button>
                        </div>
                    </td>
                </tr>
                </#list>
            <#else>
                <tr>
                    <td colspan="6" style="color:red;text-align:center;font-weight:bold;">暂无符合条件的码表信息</td>
                </tr>
            </#if>
            </tbody>
        </table>
    </form>
</@override>
<@override name="page-scripts">
    <script>
        $(function(){
            layui.use(['form','layer', 'jquery'], function(){
                var form=layui.form;
                var layer=layui.layer;
                var $ = layui.jquery;
                $('.js-reset').on('click', function(){
                    $('#pageNo').val(1);
                    $('#tableName').val("");
                    $('form:first').submit();
                });
                $('.js-list').on('click', function(){
                    var tableId = $(this).attr('data-id');
                    var tableName = $(this).attr('data-name');
                    window.parent.dynamicAddTab("码表-"+tableName,"${contextPath}/codetable/"+tableId+"/management", "fa fa-external-link","");
                })
            })
        })
    </script>
</@override>
<@extends name="/layout/basepage.html"/> 